import request from '@/utils/request'

// 根据ID获取编辑数据
export function queryEditData(id) {
  return request({
    url: `/api/v1/shopConstruct/${id}`,
    method: 'get'
  })
}

// 根据ID获取详情数据
export function queryDetailData(id) {
  return request({
    url: `/api/v1/shopConstruct/detail/${id}`,
    method: 'get'
  })
}

// 获取门店区域及系列数据
export function queryAreaSeriesData(data) {
  return request({
    url: `/api/v1/designAreaSeries/page`,
    method: 'post',
    data
  })
}

// 保存门店建设数据
export function submitEditShopData(data) {
  return request({
    url: `/api/v1/shopConstruct`,
    method: data.id ? 'put' : 'post',
    data
  })
}

// 获取市场交接异常ID
export function getExceptionType(data) {
  return request({
    url: `/api/v1/configExceptionHandle/page`,
    method: 'post',
    data
  })
}

// 保存市场交接数据
export function submitMarketApply(data) {
  return request({
    url: `/api/v1/shopException`,
    method: 'post',
    data
  })
}

// 终止
export function updateState(data) {
  return request({
    url: `/api/v1/shopConstruct`,
    method: 'put',
    data
  })
}

// 门店异常审核
export function examineException(data) {
  return request({
    url: `/api/v1/shopException/review`,
    method: 'post',
    data
  })
}

// 获取门店异常详情
export function getExceptionDeatil(id) {
  return request({
    url: `/api/v1/shopException/${id}`,
    method: 'get'
  })
}

// 获取区域数据
export function queryAreaData(data) {
  return request({
    url: `/api/v1/configArea/page`,
    method: 'post',
    data
  })
}

